Improving Lazy Non-Deterministic Computations by Demand Analysis
نویسنده
چکیده
Functional logic languages combine lazy (demand-driven) evaluation strategies from functional programming with non-deterministic computations from logic programming. The lazy evaluation of non-deterministic subexpressions results in a demand-driven exploration of the search space: if the value of some subexpression is not required, the complete search space connected to it is not explored. On the other hand, this improvement could cause efficiency problems if unevaluated subexpressions are duplicated and later evaluated in different parts of a program. In order to improve the execution behavior in such situations, we propose a program analysis that guides a program transformation to avoid such inefficiencies. We demonstrate the positive effects of this program transformation with KiCS2, a recent highly efficient implementation of the functional logic programming language Curry. 1998 ACM Subject Classification D.1.6 Logic Programming
منابع مشابه
Improving Deterministic Computations in Lazy Functional Logic Languages
The detection of deterministic computations at run-time can be used to introduce dynamic cuts pruning the search space and thus increasing the efficiency of functional logic systems. This idea was introduced in an early work of R. Loogen and S. Winkler. However the proposal of these authors cannot be used in current implementations because it did not consider non-deterministic functions and was...
متن کاملAdding Plural Arguments to Curry Programs
Functional logic languages combine lazy (demand-driven) evaluation strategies from functional programming with non-deterministic computations from logic programming. To provide a strategy-independent semantics, most languages are based on the call-time choice semantics where parameters are passed as values. From an implementation point of view, the call-time choice semantics fits well with shar...
متن کاملLazy Relations
We present a relational model of non-strict computations in an imperative, non-deterministic context. Undefinedness is represented independently of non-termination. The relations satisfy algebraic properties known from other approaches to model imperative programs; we introduce additional laws that model dependence in computations in an elegant algebraic form using partial orders. Programs can ...
متن کاملTowards a Safe Partial Evaluation of Lazy Functional Logic Programs
Partial Evaluation is a well-known technique for specializing programs w.r.t. a given restriction of their input data. Although partial evaluation has been widely investigated in the context of functional and functional logic languages like Haskell or Curry, current schemes are either overly restrictive or destroy sharing through the specialization process, which may produce incorrect specializ...
متن کاملObserving Functional Logic Computations
A lightweight approach to debugging functional logic programs by observations is presented, implemented for the language Curry. The Curry Object Observation System (COOSy) comprises a portable library plus a viewing tool. A programmer can observe data structures and functions by annotating expressions in his program. The possibly partial values of observed expressions that are computed during p...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2012